package com.bjc.mapper;

import com.bjc.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    @Select("select * from tb_user")
    List<User> selectUserList();

    @Select("select * from tb_user where id=#{id}")
    User selectOneUser(Long id);

    @Select("select * from tb_user where username=#{userName}")
    User selectOneUserByName(String userName);
//    private Long id;
//    private String username;
//    private String password;
//    private String email;
//    private Integer gender;
//    private Integer age;

    @Insert("INSERT INTO `tb_user`(`age`, `username`, `password`, `email`, `gender`, `role`, `rolegroup`) VALUES ( #{age}, #{username}, #{password}, #{email}, #{gender}, 'user', 'activiti_user')")
    int insertUser(User user);
}
